<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
<title></title> <jsp:include page="../common/head.jsp"></jsp:include>


<style type="text/css">
body {
	padding-bottom: 40px;
}

.sidebar-nav {
	padding: 9px 0;
}

@media ( max-width : 980px) {
	/* Enable use of floated navbar text */
	.navbar-text.pull-right {
		float: none;
		padding-left: 5px;
		padding-right: 5px;
	}
}
</style>
</head>
<body>
	<form class="form-inline definewidth m20" action="${path}/user/list" method="get" id="listForm">
		用户名称： <input type="text" name="keyWords" id="username"
			class="abc input-default" placeholder="用户名/昵称" value="${RequestParameters['keyWords']}">&nbsp;&nbsp;
		<button type="submit" class="btn btn-primary">查询</button>
		&nbsp;&nbsp; <shiro:hasPermission name="sys:user:add">
		<a class="btn btn-success" href="${path}/user/add">新增用户</a>
		</shiro:hasPermission>
	</form>
	<table class="table table-bordered table-hover definewidth m10">
		<thead>
			<tr>
				<th>用户名</th>
				<th>昵称</th>
				<th>电话</th>
				<th>邮箱</th>
				<th>最后登陆时间</th>
				<th>是否启用</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${ list}"  var="u">
			<tr class="">
				<td>${u.username}</td>
				<td>${u.nickName}</td>
				<td>${u.mobile}</td>
				<td class="center">${u.email}</td>
				<td><fmt:formatDate value="${u.loginTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
				<td>
					<c:if test="${u.disabled == 0}">启用</c:if>
					<c:if test="${u.disabled != 0}">禁用</c:if>
				<td>
				<shiro:hasPermission name="sys:user:update">
				<a class="edit" href="${path}/user/add?id=${u.id}">修改</a>
				</shiro:hasPermission>
				<shiro:hasPermission name="sys:user:roleView">
				&nbsp;&nbsp;<a class="edit" href="${path}/user/editRole?id=${u.id}">修改权限</a>
				</shiro:hasPermission>
				</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	<jsp:include page="../common/page.jsp"></jsp:include> <jsp:include page="../common/foot.jsp"></jsp:include>
</body>
</html>
